var a = getApp();

Page({
    data: {
        language: "",
        sum_activation_love: null,
        activation_love2: null,
        love_name: "",
        usable: 0,
        member_froze_love: "",
        fixed_proportion: "",
        fixed_activation_love: "",
        first_commission: null,
        second_three_Commission: null,
        other: null,
        order_money: null,
        order_money2: null,
        proportion: null,
        proportion2: null,
        team_leve_award: null,
        fetter_proportion: null,
        actual_activation_love: null,
        created_id: null,
        created_at: null,
        order_sn: null,
        search: ""
    },
    onLoad: function(a) {
        this.setData({
            search: a.id
        }), this.getUsable(), this.getBalance();
    },
    onReady: function() {
        var a = wx.getStorageSync("langIndex");
        this.setData({
            language: a.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getUsable: function() {
        var t = this, o = a.getNetAddresss("plugin.love.Frontend.Controllers.page.index");
        a._getNetWork({
            url: o,
            success: function(a) {
                1 === a.data.result ? t.setData({
                    usable: a.data.data.usable,
                    love_name: a.data.data.love_name
                }) : wx.showToast({
                    title: a.data.msg,
                    icon: "none"
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getBalance: function() {
        var t = this, o = a.getNetAddresss("plugin.love.Frontend.Modules.Love.Controllers.activation-record-detail.index");
        o += "&record_id=" + this.data.search, a._getNetWork({
            url: o,
            success: function(a) {
                1 === a.data.result ? t.setData({
                    member_froze_love: a.data.data.fixed_activation.member_froze_love,
                    fixed_proportion: a.data.data.fixed_activation.fixed_proportion,
                    order_money: a.data.data.first_commission.order_money,
                    fixed_activation_love: a.data.data.fixed_activation.fixed_activation_love,
                    proportion: a.data.data.first_commission.proportion,
                    activation_love: a.data.data.first_commission.activation_love,
                    order_money2: a.data.data.second_three_Commission.order_money,
                    proportion2: a.data.data.second_three_Commission.proportion,
                    activation_love2: a.data.data.second_three_Commission.activation_love,
                    team_leve_award: a.data.data.second_three_Commission.team_leve_award,
                    fetter_proportion: a.data.data.second_three_Commission.fetter_proportion,
                    created_id: a.data.data.other.id,
                    created_at: a.data.data.other.created_at,
                    sum_activation_love: a.data.data.other.sum_activation_love,
                    actual_activation_love: a.data.data.other.actual_activation_love
                }) : wx.showToast({
                    title: a.data.msg,
                    icon: "none"
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    }
});